class Calculator {
  def calculate(a: Int, b: Int, op: String): String = {
    op match {
      case "+" => a + b
      case "-" => a - b
      case "*" => a * b
      case "/" => a / b
      case _ => "Invalid operator"
       if (b == 0) "Division by zero is not allowed"  
        else a / b  
      case _ => "Invalid operator"  
    }
  }
}
// 示例  
object Main {  
  def main(args: Array[String]): Unit = {  
    val calculator = new Calculator()  
      
    println(calculator.calculate(5, 3, '+'))      // 输出: 8  
    println(calculator.calculate(5, 3, '-'))      // 输出: 2  
    println(calculator.calculate(5, 3, '*'))      // 输出: 15  
    println(calculator.calculate(5, 3, '/'))      // 输出: 1  
    println(calculator.calculate(5, 0, '/'))      // 输出: Division by zero is not allowed  
    println(calculator.calculate(5, 3, '%'))      // 输出: Invalid operator  
  }  
}